licenses(["notice"])

cc_library(
    name = "status_macros_lib",
    hdrs = ["status_macros.h"],
    deps = [
        "@absl//absl/base:core_headers",
        "@absl//absl/status",
    ],
)

cc_library(
    name = "general_voter_lib",
    hdrs = ["general_voter.h"],
    deps = [
        ":concurrency_lib",
        ":status_macros_lib",
        "@absl//absl/container:flat_hash_map",
        "@absl//absl/container:flat_hash_set",
        "@absl//absl/functional:function_ref",
        "@absl//absl/status",
        "@absl//absl/status:statusor",
        "@absl//absl/synchronization",
        "@absl//absl/time",
        "@absl//absl/types:span",
        "@eigen3//:eigen",
    ],
)

cc_library(
    name = "concurrency_lib",
    hdrs = ["concurrency.h"],
    deps = [
        ":status_macros_lib",
        "@absl//absl/algorithm:container",
        "@absl//absl/functional:function_ref",
        "@absl//absl/status",
        "@absl//absl/status:statusor",
    ],
)

cc_library(
    name = "general_voter_6dof",
    srcs = ["general_voter_6dof.cc"],
    hdrs = ["general_voter_6dof.h"],
    deps = [
        ":general_voter_lib",
        ":intersection_tools",
        "@absl//absl/base:core_headers",
        "@absl//absl/container:flat_hash_map",
        "@absl//absl/flags:flag",
        "@absl//absl/time",
        "@eigen3//:eigen",
    ],
)

cc_library(
    name = "intersection_tools",
    hdrs = ["intersection_tools.h"],
    deps = ["@eigen3//:eigen"],
)

cc_binary(
    name = "general_voter_6dof_main",
    srcs = ["general_voter_6dof_main.cc"],
    deps = [
        ":general_voter_6dof",
        "@absl//absl/algorithm:container",
        "@absl//absl/container:flat_hash_set",
        "@absl//absl/flags:flag",
        "@absl//absl/flags:parse",
        "@absl//absl/strings",
        "@absl//absl/strings:str_format",
        "@absl//absl/time",
        "@eigen3//:eigen",
    ],
)

cc_binary(
    name = "general_voter_2d_lines_main",
    srcs = ["general_voter_2d_lines_main.cc"],
    deps = [
        ":general_voter_lib",
        "@absl//absl/flags:flag",
        "@absl//absl/flags:parse",
        "@absl//absl/random",
        "@absl//absl/random:distributions",
        "@absl//absl/time",
        "@eigen3//:eigen",
        "@opencv//:core",
        "@opencv//:highgui",
        "@opencv//:imgcodecs",
        "@opencv//:imgproc",
    ],
)
